
/****** Object:  Table [dbo].[XJInspectionPlan_XJEquipmentCategory_Mapping]    Script Date: 2025/8/21 10:04:48 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[XJInspectionPlan_XJEquipmentCategory_Mapping](
	[XJInspectionPlan_Id] [int] NOT NULL,
	[XJEquipmentCategory_Id] [int] NOT NULL,
 CONSTRAINT [PK_XJInspectionPlan_XJEquipmentCategory_Mapping] PRIMARY KEY CLUSTERED 
(
	[XJInspectionPlan_Id] ASC,
	[XJEquipmentCategory_Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

INSERT INTO [dbo].[XJInspectionPlan_XJEquipmentCategory_Mapping]
           ([XJInspectionPlan_Id]
           ,[XJEquipmentCategory_Id])
SELECT Id,CategoryId FROM XJInspectionPlan

ALTER TABLE  XJInspectionPlan DROP COLUMN CategoryId
GO
